import request from '@/utils/request';

/**
 * 获取国标配置信息
 * @returns {*}
 */
export function getConfigInfo() {
    return request({
        url: '/iot/gb/configInfo',
        method: 'get'
    })
}

/**
 * 获取国标服务器资源信息
 * @returns {*}
 */
export function getResourceInfo() {
    return request({
        url: '/iot/gb/resourceInfo',
        method: 'get'
    })
}

/**
 * 获取国标设备列表
 * @returns {*}
 */
export function getDeviceList(query) {
    return request({
        url: '/iot/gb/query/devices/page',
        method: 'get',
        params: query
    })
}

/**
 * 获取推流列表
 * @param query
 * @returns {*}
 */
export function getPushList(query) {
    return request({
        url: '/iot/gb/query/pushList',
        method: 'get',
        params: query
    })
}

/**
 * 获取拉流列表
 * @param query
 * @returns {*}
 */
export function getProxyList(query) {
    return request({
        url: '/iot/gb/query/proxyList',
        method: 'get',
        params: query
    })
}

/**
 * 修改数据流传输模式
 * @param query
 * @returns {*}
 */
export function getTransport(query) {
    return request({
        url: '/iot/gb/getTransport/'+ query.deviceId + '/' + query.streamMode,
        method: 'get',
    })
}

/**
 * 分页查询通道
 * @param query
 * @returns {*}
 */
export function getChannels(query) {
    return request({
        url: '/iot/gb/getChannels/'+ query.deviceId,
        method: 'get',
        params: query
    })
}

/**
 * 使用ID查询国标设备
 * @param query
 * @returns {*}
 */
export function getDeviceById(query) {
    return request({
        url: '/iot/gb/getDeviceById/'+ query.deviceId,
        method: 'get',
    })
}

/**
 * 开启/关闭通道的音频
 * @param query
 * @returns {*}
 */
export function getChangeAudio(query) {
    return request({
        url: '/iot/gb/getChangeAudio',
        method: 'get',
        params: query
    })
}

/**
 * 修改通道的码流类型
 * @param query
 * @returns {*}
 */
export function updateChannelID(query) {
    return request({
        url: '/iot/gb/updateChannelID',
        method: 'get',
        params: query
    })
}

/**
 * 开始点播
 * @param query
 * @returns {*}
 */
export function start(query) {
    return request({
        url: '/iot/gb/start',
        method: 'get',
        params: query
    })
}

/**
 * 结束点播
 * @param query
 * @returns {*}
 */
export function stop(query) {
    return request({
        url: '/iot/gb/stop',
        method: 'get',
        params: query
    })
}

/**
 * 获取通道同步进度
 * @param query
 * @returns {*}
 */
export function getSyncStatus(query) {
    return request({
        url: '/iot/gb/getSyncStatus/' + query.deviceId,
        method: 'get',
    })
}

/**
 * 同步设备通道
 * @param query
 * @returns {*}
 */
export function devicesSync(query) {
    return request({
        url: '/iot/gb/devicesSync/' + query.deviceId,
        method: 'get',
    })
}



